#!/sbin/openrc-run

name="Greenbone Vulnerability Manager"
command=/usr/bin/gvmd

: ${GVMD_USER:=gvm}
: ${GVMD_GROUP:=gvm}
: ${GVMD_TIMEOUT:=30}
: ${GVMD_LISTEN_ADDRESS_UNIX:=/run/gvmd/gvmd.sock}
: ${GVMD_SCANNER_HOST:=/run/ospd/ospd-openvas.sock}
: ${GVMD_LISTEN_OWNER:=$GVMD_USER}
: ${GVMD_LISTEN_GROUP=$GVMD_GROUP}
: ${GVMD_LISTEN_MODE:=755}
: ${GVMD_GNUTLS_PRIORITIES:=NORMAL}
: ${GVMD_LISTEN_ADDRESS_TCP:=127.0.0.1}
: ${GVMD_PORT:=9390}

retry="${GVMD_TIMEOUT}"
command_args="${GVMD_OPTIONS} --listen=${GVMD_LISTEN_ADDRESS_TCP} --port=${GVMD_PORT} --osp-vt-update=${GVMD_SCANNER_HOST} --scanner-host=${GVMD_SCANNER_HOST} --gnutls-priorities=${GVMD_GNUTLS_PRIORITIES} --db-user=${GVMD_USER}"
pidfile="/run/gvmd/gvmd.pid"

depend() {
        after firewall
        need net ospd-openvas
}

start_pre() {
    checkpath -f -o ${GVMD_USER}:${GVMD_GROUP} /var/log/gvm/gvmd.log
    checkpath -f -o ${GVMD_USER}:${GVMD_GROUP} /var/lib/gvm/feed-update.lock
}

